<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="primus" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fc" tagdir="/WEB-INF/tags/form" %>
<%@ taglib prefix="btn" tagdir="/WEB-INF/tags/btn" %>
<primus:page title="分类列表">
    <jsp:body>
        <div class="breadcrumbs ace-save-state" id="breadcrumbs">
            <ul class="breadcrumb">
                <li>
                    <i class="ace-icon fa fa-home home-icon"></i>
                    <a href="welcome.do">
                        首页
                    </a>
                </li>
                <li>
                    商品管理
                </li>
                <li class="active">
                    分类管理
                </li>
            </ul>
        </div>

        <div class="page-content">
            <fc:form _action="management/category/list" _name="分类搜索" _buttons="false" _method="get">
                <fc:text _title="分类名称" _name="name" _placeholder="分类名称" _value="${reqVo.name}" _layout="three"/>
                <fc:select _title="父分类" _name="parentCategoryId" _items="${categories.content}" _valuePropertyName="id" _value="${reqVo.parentCategoryId}"
                           _propertyName="name" _layout="three"/>
                <div class="inline">
                    <btn:button text="搜索" type="submit" />
                </div>
            </fc:form>
            <div class="row">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <div class="row">
                        <div class="col-xs-12">
                            <h3 class="header smaller lighter blue">
                                分类管理 <span class="inline help-block"></span>
                            </h3>
                            <table id="cat-table" class="table table-hover">
                                <thead>
                                <tr>
                                    <th class="name">分类ID</th>
                                    <th>分类名称</th>
                                    <th>启用状态</th>
                                    <th>排序</th>
                                    <th class="status">更新时间</th>
                                    <th class="center operate">操作</th>
                                </tr>
                                </thead>

                                <tbody>
                                <c:forEach items="${pages.content}" var="item">
                                    <tr id="tr-${item.id}">
                                        <td><c:out value="${item.id}"/></td>
                                        <td><c:out value="${item.name}"/></td>
                                        <td>
                                            <c:out value="${empty item.status?'':
                                            item.status}"/>
                                        </td>
                                        <td><c:out value="${item.idx}"/></td>
                                        <td>
                                            <fmt:formatDate value="${item.createTimeStamp}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                        </td>
                                        <td>
                                            <div class="hidden-sm hidden-xs btn-group">
                                                <a href="management/category/<c:out value='${item.id}'/> "
                                                   class="btn btn-minier btn-info">
                                                    <i class="ace-icon fa fa-pencil bigger-120"></i>
                                                </a>
                                            </div>
                                        </td>
                                    </tr>
                                </c:forEach>
                                </tbody>
                            </table>

                            <primus:springPagePagination url="management/category/list" springPage="${pages}"/>

                        </div><!-- /.span -->
                    </div><!-- /.row -->
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div>
    </jsp:body>
</primus:page>
